// Copyright (c) 2023 0x5BFA
// Licensed under the MIT License. See the LICENSE.

namespace FluentHub.Octokit.Models.v4
{
	/// <summary>
	/// An individual vulnerability within an Advisory
	/// </summary>
	public class SecurityVulnerability
	{
		/// <summary>
		/// The Advisory associated with this Vulnerability
		/// </summary>
		public SecurityAdvisory Advisory { get; set; }

		/// <summary>
		/// The first version containing a fix for the vulnerability
		/// </summary>
		public SecurityAdvisoryPackageVersion FirstPatchedVersion { get; set; }

		/// <summary>
		/// A description of the vulnerable package
		/// </summary>
		public SecurityAdvisoryPackage Package { get; set; }

		/// <summary>
		/// The severity of the vulnerability within this package
		/// </summary>
		public SecurityAdvisorySeverity Severity { get; set; }

		/// <summary>
		/// When the vulnerability was last updated
		/// </summary>
		public DateTimeOffset UpdatedAt { get; set; }

		/// <summary>
		/// Humanized string of "When the vulnerability was last updated"
		/// <summary>
		public string UpdatedAtHumanized { get; set; }

		/// <summary>
		/// A string that describes the vulnerable package versions.
		/// This string follows a basic syntax with a few forms.
		/// + `= 0.2.0` denotes a single vulnerable version.
		/// + `&lt;= 1.0.8` denotes a version range up to and including the specified version
		/// + `&lt; 0.1.11` denotes a version range up to, but excluding, the specified version
		/// + `&gt;= 4.3.0, &lt; 4.3.5` denotes a version range with a known minimum and maximum version.
		/// + `&gt;= 0.0.1` denotes a version range with a known minimum, but no known maximum
		/// </summary>
		public string VulnerableVersionRange { get; set; }
	}
}
